<template>
	<view id="content" class="registration-agreement" v-html="article">
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:"",
				article:"",
			};
		},
		onLoad(e) {
			this.getData(e.type)
		},
		updated() {
			let content=document.getElementById('content');
			let imgs =content.getElementsByTagName('img');
			let videos =content.getElementsByTagName('video');
			for (let i=0;i<imgs.length;i++){
				imgs[i].style.width="100%"
			}
			for (let i=0;i<videos.length;i++){
				videos[i].style.width="100%"
			}
		},
		methods:{
			getData(type) {
				this.$request({
					url: "api/consult/single",
					header:"application/x-www-form-urlencoded",
					data: {
						type_id:type
					}
				}).then(res => {
					console.log('res: ', res)
					if (res.code == 1) {
						// res.data.data=res.data.data.replace(/<img src=\"/g,'<img src="'+this.$BASE_URL)
						this.article = res.data?.details?.content
						console.log('this.article: ', this.article)
						this.title = res.data?.details?.title
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.registration-agreement{
	padding: 24rpx;
	font-size: 26rpx;
	line-height: 40rpx;
	color: #000000;
}
</style>
